package com.worldcup.model.user;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @author duwan.zq
 * @date 2019/05/06
 */
@Data
@Entity
@Table(uniqueConstraints = {@UniqueConstraint(name = "uk_openid", columnNames = {"openId"})})
@EntityListeners(AuditingEntityListener.class)
public class UserAddInfo {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotNull
    private String openid;

    /** 微信号 **/
    private String wechat;

    private Integer gender;

    private String city;

    /** 标签 **/
    private String tag;

    /** 签名 **/
    private String sign;

    @CreatedDate
    private LocalDateTime gmtCreate;

    @LastModifiedDate
    private LocalDateTime gmtModified;

}
